import request from "@/utils/request"

/**
 * 获取学校列表
 * @param {Object} params
 */
// export function getschoolList(params) {
// 	return request.get("school/school/list", {
// 		params: params
// 	}).then(res => {
// 		return res
// 	})
// }

/**
 * 获取院校选专业列表
 * @param {Object} params
 */
export function getschoolsubject(school) {
	return request.post("major/select/subject", {
	
		school:school
	   
    
	}).then(res => {
		console.log("get",res)
		return res
	})
}

/**
 * 获取字典列表
 */
export function getdictList() {
	return request.get("dict/type/school_level").then(res => {
		return res
	})
}
export function getSchooltypesdic() {
	return request.get("dict/type/school_types").then(res => {
		return res
	})
}
export function getSchoollevelsdic() {
	return request.get("dict/type/school_level").then(res => {
		return res
	})
}
export function getSchoolsubjectsdic() {
	return request.get("dict/type/sm_subject").then(res => {
		return res
	})
}

/**
 * 获取地区列表
 */
export function getAreaList() {
	return request.get("children/list").then(res => {
		return res
	})
}




/**
 * 院校对应专业详情信息
 * @param {Object} params
 */
export function getschoolSmajorslist(params) {
	return request.get("/school/smajors/detail", {params:params}).then(res => {
		return res
	})
}
export function getschoollist(query) {
	return request.get("/school/smajors/list", {
		params:query
		}).then(res => {
		return res
	})
}

export function getSchoolListByCode(scode) {
  return request.get(`/schoolscode/list/${scode}`).then(res => {
    return res
   })
   
}



export function selectMajortoschool(subject) {
  return request.post('/subject/select/major', { subject:subject })
    .then(res => {
      return res
      
    })
    .catch(error => {
      // 处理错误情况
    });
}



/**
 * 帮助文档内容详情
 * @param {Object} params
 */
export function getDocumentContent(params) {
	return request.get("dc/content", {params:params}).then(res => {
		return res
	})
}

/**
 * 提交文档点赞
 * @param {Object} params
 */
export function submitArticleCollect(params) {
	return request.post("article/collect", params).then(res => {
		return res
	})
}